home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / risc_src.lha / risc_sources / pmax / pmaxbuild.t < prev    next >
Encoding:
Text File  |  1989-10-23  |  4.2 KB  |  124 lines

  1. (herald sunbuild)
  2. #|
  3.  
  4. To build a new system from sources:
  5.  
  6. 1. You should be in a directory with sources and tsystem as subdirectories
  7.    Execute the shell script in tsystem/envset
  8. 2. Start up tsystem/xt and load this file into orbit-env
  9. 3. (compile-support) and (exit)
  10. 4. Start up tsystem/xt again and load this file into orbit-env
  11. 5. (compile-sources) and (link-t '(tsystem new)) and (exit)
  12. 6. cd tsystem; linkt new.o new; cd ..
  13. 7. tsystem/new is a T without compiler. Start up new with a large heap.
  14. 8. ((*value t-implementation-env 'load-and-suspend-system) '(tsystem new) t)
  15.    (exit)
  16. 9. cd tsystem; linkt new.o new    That's it.
  17.  
  18. |#
  19.  
  20. ;;; Build compiler early binding environment
  21.  
  22. (lset *endian* 'little)
  23.  
  24. (*define user-env 'compile-support
  25. (lambda ()
  26. (create-support '(t3_primops mipsconstants) '(t3_primops mipsconstants))
  27. (load '(t3_primops mipsconstants t) orbit-env)
  28. (orbit-mips-setup 't3_primops)
  29. (orbit-init 'base)
  30. (set (orbit-syntax-table) primop-syntax-table)
  31. (set *compile-primops?* nil)
  32. (create-support '(t3_primops mipsprimops)   '(t3_primops mipsprimops))
  33. (create-support '(t3_primops mipsarith)     '(t3_primops mipsarith))
  34. (create-support '(t3_primops locations)    '(t3_primops locations))
  35. (create-support '(t3_primops mipslow)       '(t3_primops mipslow))
  36. (create-support '(t3_primops predicates)       '(t3_primops predicates))
  37. (orbit-init 'base  
  38.             'constants 'primops 'arith 'locations 'low 'predicates)
  39. (create-support '(t3_primops open)    '(t3_primops open))
  40. (create-support '(t3_primops aliases) '(t3_primops aliases))
  41. (create-support '(t3_primops carcdr)  '(t3_primops carcdr))
  42. (create-support '(t3_primops mipsgenarith)  '(t3_primops mipsgenarith))))
  43.  
  44. ;;; compile compiler code in early binding environment, runtime system
  45.  
  46. (*define user-env 'compile-sources
  47. (lambda ()
  48. (set (orbit-syntax-table) primop-syntax-table)
  49. (comfile '(t3_primops base))
  50. (compile-primop-source '(t3_primops mipsprimops   mli))
  51. (compile-primop-source '(t3_primops mipsarith     mli))
  52. (compile-primop-source '(t3_primops locations    mli))
  53. (compile-primop-source '(t3_primops mipslow       mli))
  54. (compile-primop-source '(t3_primops mipsgenarith    mli))
  55. (set *compile-primops?* nil)
  56. (set (table-entry *modules* 'bignum) '(osys risc_bignum))
  57. (load-quietly '(t3_primops mipsconstants t) orbit-env)
  58. (set (orbit-syntax-table) (env-syntax-table t-implementation-env))
  59. (orbit-mips-init 't3_primops)
  60. (define (comsys system . start)
  61.   (walk (lambda (file)
  62.       (xcase (car file)
  63.             ((osys)
  64.          (set (tc-syntax-table) (env-syntax-table t-implementation-env))
  65.          (comfile file))
  66.         ((t3_primops)
  67.          (set (tc-syntax-table) primop-syntax-table)
  68.          (bind ((write-support-file false))
  69.            (comfile file)))))
  70.     (let ((files (xcase system
  71.                ((z) *zvm-system*)
  72.                ((t) *t-system*))))
  73.       (if start (mem alikev? (car start) files) files))))
  74. (load '(osys pmax_files) orbit-env)
  75. (comsys 't)
  76. (comfile '(link defs))
  77. (comfile '(link linker))
  78. (comfile '(link pmax_link))
  79. (comfile '(link lp_table))
  80. (comfile '(link suspend))
  81. (comfile '(link pmaxsuspend))
  82. (comfile '(tscheme scheme))
  83. (comfile '(tscheme syntax))
  84. (comfile '(tscheme system))
  85. (comfile '(tscheme runtime))
  86. (comfile '(tscheme compiler))
  87. (set (tc-syntax-table) (env-syntax-table orbit-env))
  88. (comfile '(front_end pmaxfix))
  89. (walk comfile
  90.       (append *orbit-files*
  91.           *top-files*
  92.           *front-files*
  93.           *back-end-files*
  94.           *orbit-mips-files*
  95.           *tas-mips-files*))))
  96.  
  97.  
  98. (define (load-linker . system)
  99.   (let* ((system (if (null? system) 
  100.                      ((*value t-implementation-env 'machine-type) 
  101.                       ((*value t-implementation-env 'local-machine)))
  102.                      (car system)))
  103.          (link-env (make-locale orbit-env 'link-env)))
  104.     (*define standard-env 'link-env link-env)
  105.     (load '(link defs )         link-env)
  106.     (load '(link linker )       link-env)
  107.     (load 
  108.      '(link pmax_link)
  109.      link-env)
  110.     (load '(t3_primops mipsconstants t)  link-env)
  111.     (*define standard-env  'link
  112.          (lambda (files outfile)
  113.            (set (repl-results) nil)
  114.            (gc)
  115.            ((*value link-env 'link) files outfile)))))
  116.  
  117. (*define user-env 'link-t
  118. (lambda (file)
  119. (load-linker)
  120. (load '(osys pmax_files) orbit-env)
  121. (link *t-system* file)))
  122.  
  123.  
  124.